<!DOCTYPE html>
<html>
<head>
    <title>模具改良改善台账-自主维修台账</title>
    #parse("sys/header.html")
    <style>
        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("modulerecord:import"))
                <Upload ref="uploadFile"
                        action="../modulerecord/importMoldGLGS"
                        :format="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :show-upload-list="false"
                        :on-success="handleSuccess2" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="error"><i class="fa fa-hand-o-down"></i>&nbsp;导入OA改良改善</i-button>
                </Upload>

                <Upload ref="uploadFile"
                        action="../modulerecord/importGLGS"
                        :format="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :show-upload-list="false"
                        :on-success="handleSuccess2" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="error"><i class="fa fa-hand-o-down"></i>&nbsp;导入改良改善</i-button>
                </Upload>

                <Upload ref="uploadFile"
                        action="../modulerecord/importGLGS"
                        :format="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :show-upload-list="false"
                        :on-success="handleSuccess2" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="error"><i class="fa fa-hand-o-down"></i>&nbsp;导入自主维修</i-button>
                </Upload>
                #end

                #if($shiro.hasPermission("modulerecord:check"))
                <i-button type="primary" @click="check"><i class="fa fa-gavel"></i>&nbsp;审核</i-button>
                #end
                #if($shiro.hasPermission("modulerecord:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("modulerecord:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("modulerecord:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="moduleRecord" :rules="ruleValidate" :label-width="120">
            <Row>
                <i-col span="11">
                    <Form-item label="项目名称" prop="proName">
                        <i-input v-model="moduleRecord.proName" placeholder="项目名称"/>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="台账类型" prop="type">
                        <i-select @on-change="onselect" v-model="moduleRecord.type" placeholder="台账类型">
                            <i-option v-for="item in moduleTypeList" :value="item.value" :key="item.value">{{item.name}}</i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="开始时间" prop="startDate">
                        <Date-picker format="yyyy-MM-dd" v-model="moduleRecord.startDate" placeholder="开始时间"></Date-picker>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="结束时间" prop="endDate">
                        <Date-picker format="yyyy-MM-dd" v-model="moduleRecord.endDate" placeholder="结束时间"></Date-picker>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="实施单位" prop="expUnit">
                        <i-input v-model="moduleRecord.expUnit" placeholder="实施单位"/>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="实施方式" prop="impMode">
                        <i-input v-model="moduleRecord.impMode" placeholder="实施方式"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="项目收益" prop="proReve">
                        <i-input v-model="moduleRecord.proReve" placeholder="项目收益"/>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="实施背景" prop="implBack">
                        <i-input v-model="moduleRecord.implBack" placeholder="实施背景"/>
                    </Form-item>
                </i-col>
            </Row>

            <Row>
                <i-col span="11">
                    <Form-item label="验证方案/效果" prop="valPlan">
                        <i-input v-model="moduleRecord.valPlan" placeholder="验证方案/效果验证"/>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="加工/实施方案" prop="proPlan">
                        <i-input v-model="moduleRecord.proPlan" placeholder="加工方案/实施方案"/>
                    </Form-item>
                </i-col>
            </Row>

            <Row v-if="show">
                <i-col span="11">
                    <Form-item label="改善措施" prop="proMethod">
                        <i-input v-model="moduleRecord.proMethod" placeholder="改善措施-改良改善"/>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="改善效果" prop="impEff">
                        <i-input v-model="moduleRecord.impEff" placeholder="改善效果-改良改善"/>
                    </Form-item>
                </i-col>
            </Row>

            <Row>
                <i-col span="11">
                    <Form-item label="备注" prop="remark">
                        <i-input type="textarea" v-model="moduleRecord.remark" placeholder="备注"/>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="维修人员名称" prop="repairUserName">
                        <i-input v-model="moduleRecord.repairUserName" placeholder="维修人员名称"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="16">
                    <Form-item label="附件" prop="url">
                        <i-hidden v-model="moduleRecord.fileUrl" readonly></i-hidden>
                        <i-input v-model="moduleRecord.fileName" placeholder="请上传" readonly></i-input>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload ref="uploadFile" style="width: 300px;" action="../sys/oss/mold/file"
                                :on-success="handleSuccess" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="md-arrow-dropdown-circle"  @click="eyeFile(moduleRecord.fileUrl)">预览</i-button>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/module/modulerecord.js?_${date.systemTime}"></script>
</body>
</html>
